package com.drcoffee.drcoffeemall.mapper;

import com.drcoffee.drcoffeemall.entry.AttNo4OCM;
import com.drcoffee.drcoffeemall.entry.Attachment;
import com.drcoffee.drcoffeemall.entry.Explosion;
import com.drcoffee.drcoffeemall.entry.PartOCM;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Mapper
@Repository
public interface AttachmentMapper {
    List<Attachment> getAttachment(Integer machine_id, String type, String search);

    List<Attachment> getAttachmentById(@Param("language") String language, @Param("partCodes") List<String> partCodes);

    List<Attachment> getAttachmentAll(String search);

    List<Attachment> getAttachmentBySearch(String type, String search);

    List<String> getDots(Integer dot_id);

    Map<String, String> GetFilePath();

    Integer updatepartimgurl(String image_url, String part_code);

    Integer editInfo(Attachment attachment);

    Integer editPrice(Attachment attachment);

    String getOCMPriceDocno();

    Integer InsertOCMPrice(PartOCM partOCM);

    Integer InsertOCMPriceNo(AttNo4OCM attNo4OCM);

    List<PartOCM> getNewList();

    Integer partExist(String part_code);

    Integer createPart(String part_code);

    Integer updatePart1(String part_code, String price);

    Integer updatePart2(String part_code, String price);

    void insertParts(List<Attachment> parts);

    void insertPartPrice(Map<String, Object> partPrice);

    @Select("select image_url from t_attachment where type <> 'N' and language = 'CN'")
    List<String> getPartImages();

    @Select("SELECT part_code FROM t_attachment WHERE language = #{l1} AND part_code NOT IN (SELECT part_code FROM t_attachment WHERE language = #{l2})")
    List<String> getCnEnDiscrepancy(String l1, String l2);


    List<String> getPartCodeByImgUrls(List<String> differenceImgList);

    List<Map<String, Object>> getErpParts(Map<String, Object> paramMap);

    List<Map<String, Object>> getErpInventory(Map<String, Object> paramMap);


}
